package com.lry.netty01;

import com.lry.netty01.server.Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.HashSet;
import java.util.Set;

@SpringBootApplication
public class Netty01Application implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(Netty01Application.class, args);
    }


    @Autowired
    private Server server;

    private Set<Integer> ports = new HashSet<>();
    {
        ports.add(9091);
        ports.add(9092);
        ports.add(9093);
    }

    @Override
    public void run(String... args) throws Exception {

        server.run(args,ports);
    }
}
